-
Notifications
You must be signed in to change notification settings - Fork 169
Add new slave_wifi_rest_api example: REST Wi-Fi control based on original slave (IDFGH-16209) #860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add new slave_wifi_rest_api example: REST Wi-Fi control based on original slave (IDFGH-16209) #860
Conversation
Introduces a new example 'slave_wifi_rest_api' for the eppp_link component, providing a REST API for Wi-Fi management (status, scan, connect, disconnect) and a ready-to-use HTML web panel. Includes CMake, Kconfig, and configuration files for multiple transports, as well as implementation for both direct and channel-based Wi-Fi control. Enables dynamic Wi-Fi reconfiguration and CORS support for browser-based management.
Added a link to the original example and updated the web UI reference to point to the web panel documentation for better navigation and clarity.
Revised links in the main and webPanel README files to reference the correct documentation and improve navigation. This enhances clarity for users following setup and usage instructions.
Fixed and clarified relative links in the main and webPanel README files for better navigation and accuracy.
Revised the README title to clarify that the example is based on eppp_link/slave, improving documentation accuracy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent idea with the REST API! Thanks for adding this example (already thinking about some future improvements, e.g. https or running a client on the host side).
The only thing is that code duplication -- this is largely a copy of the original example, not sure how to handle it tho -- probably better to keep in a separate example (and suggested removal of that channel option)
Also, please update your commit history and use conventional-commit message format as described here: https://github.com/espressif/esp-protocols/blob/master/CONTRIBUTING.md
(or install the pre-commit hook and let it fix your commits and formatting for you)
if(CONFIG_EXAMPLE_WIFI_OVER_EPPP_CHANNEL) | ||
set(wifi_over_channels channel_wifi_station.c) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest removing this option in this example (just to simplify it and focus on what's important)
- that would also remove the Kconfig option and the source
channel_wifi_station.c
Changes in this PR
slave_wifi_rest_api
based on the original slave example.GET /wifi/status
— Wi-Fi connection state (connected/disconnected, SSID, RSSI)GET /wifi/scan
— scan for available Wi-Fi networksPOST /wifi/connect
— connect to network with provided SSID/password (JSON)POST /wifi/disconnect
— disconnect from current Wi-FiOPTIONS
handler for CORS/browser compatibilitywebPanel/
folder with a simple HTML+JS frontend (webPanel/README.md) for API demonstration and testing.